<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>all方法的使用</title>
	</head>
	<body>
		<script type="text/javascript">
			Promise.all([
				new Promise((resolve,reject) => {
					$ajax({
						url:'url1',
						success:function(data) {
							resolve(data)
						}
					})
				}),
				new Promise((resolve,reject) => {
					$ajax({
						url:'url2',
						success:function(data){
							resolve(data)
						}
					})
				})
			]).then(results => {
				results[0]
				results[1]
			})
		</script>
	</body>
</html>
